import request from '../http/request'
/****************获取json模拟数据************ */
// 会员卡统计
export const statisticsMemberCardInfo=(data) => {
        print(data,'会员卡统计')
    return request({
        url: '../statistics/memberCard.json',
        method: 'get',
    });
};
//收费统计
export const statisticsCharge=(data) => {
        print(data,'收费统计')
        if(data.time=="month"){
             return request({
                url: '../statistics/charge.json',
                method: 'post',
                data:data
            })
        }else if(data.time=="season"){
             return request({
                url: '../statistics/chargeSeason.json',
                method: 'post',
                data:data
            })
        }else if(data.time=="year"){
             return request({
                url: '../statistics/chargeYear.json',
                method: 'post',
                data:data
            })
        }
   
}



//课次数统计
export const statisticsClassCount=(data) => {
        print(data,'课次数统计')
        if(data.time=="month"){
             return request({
                url: '../statistics/classCount.json',
                method: 'post',
                data:data
            })
        }else if(data.time=="season"){
             return request({
                url: '../statistics/classCountSeason.json',
                method: 'post',
                data:data
            })
        }else if(data.time=="year"){
             return request({
                url: '../statistics/classCountYear.json',
                method: 'post',
                data:data
            })
        }
}

export const statisticsAddAndStream=(data) => {
        print(data,'课次数统计')
        if(data.time=="month"){
             return request({
                url: '../statistics/addAndStreamCount.json',
                method: 'post',
                data:data
            })
        }else if(data.time=="season"){
             return request({
                url: '../statistics/addAndStreamCountSeason.json',
                method: 'post',
                data:data
            })
        }else if(data.time=="year"){
             return request({
                url: '../statistics/addAndStreamCountYear.json',
                method: 'post',
                data:data
            })
        }
}

// 打印参数
const print=(data,msg)=>{
 console.group('%c%s', 'color:blue', `${new Date().getTime()}  的获取${msg}信息----------`)
    console.log('分页参数', data)
    console.groupEnd()
}
